import vueRouter from 'vue-router';

//导入home组件
import homeContainer from './components/tabbar/home.vue';
//导入member组件
import memberContainer from './components/tabbar/member.vue';
//导入search组件
import searchContainer from './components/tabbar/search.vue';
//导入shopcart组件
import shopcartContainer from './components/tabbar/shopcart.vue';

//导入新闻列表组件
import newslist from './components/news/newslist.vue';

//导入图片分享组件
import photoslist from './components/photos/photoslist.vue';

//导入商品列表组件
import goodslist from './components/goods/goodsList.vue';

//导入商品详情页组件
import goodsInfo from './components/goods/goodsInfo.vue';

//导入图文介绍组件
import goodsDetails from './components/goods/goodsDetails.vue';

//导入商品评论组件
import goodscomment from './components/goods/goodsComment.vue';

//3.创建路由对象(子路由)
var router = new vueRouter({
    routes:[
       {path:'/',redirect:'home'},
       {path:'/home',component:homeContainer},
       {path:'/member',component:memberContainer},
       {path:'/search',component:searchContainer},
       {path:'/shopcart',component:shopcartContainer},
       {path:'/home/newslist',component:newslist},
       {path:'/home/photoslist',component:photoslist},
       {path:'/home/goodsList',component:goodslist},
       {path:'/home/goodsInfo/:id',component:goodsInfo,name:'goodsInfo'},
       {path:'/home/goodsDetails/:id',component:goodsDetails,name:'goodsDetails'},
       {path:'/home/goodsComment/:id',component:goodscomment,name:'goodscomment'},
    ],
    linkActiveClass:'mui-active'//覆盖默认的类，默认的是router-active
});

export default router;